import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import home from '@/pages/home/index'
import work from '@/pages/work/index'
import people from '@/pages/people/index'
import me from '@/pages/me/index'
import resume from '@/pages/memberCenter/resume/index'
import release from '@/pages/memberCenter/release/index'
import authentication from '@/pages/memberCenter/authentication/index'
import personal from '@/pages/memberCenter/personal/index'
import enterprise from '@/pages/memberCenter/enterprise/index'
import imageUpload from '@/pages/memberCenter/imageUpload/index'
import security from '@/pages/memberCenter/security/index'
import rebuild from '@/pages/memberCenter/rebuild/index'
import verification from '@/pages/memberCenter/verification/index'
import help from '@/pages/memberCenter/help/index'
import aboutMe from '@/pages/memberCenter/aboutMe/index'
import details from '@/pages/memberCenter/details/index'
import nearby from '@/pages/nearby/index'
import investment from '@/pages/investment/index'
import search from '@/pages/search/index'

import workDetail from '@/pages/details/index'
import login from '@/pages/login/index'
import forgetLogin from '@/pages/forgetLogin'
import register from '@/pages/register/index'
import enterpriseInformation from '@/pages/enterpriseInformation';
import serarchiList from '@/pages/searchList';
import releaseList from '@/pages/memberCenter/releaseList';
import resumeList from '@/pages/memberCenter/resumeList';
import checkResume from '@/pages/memberCenter/checkResume';
import announcementList from '@/pages/announcementList/index';
import entertainment from '@/pages/entertainment'
import payment from '@/pages/payment/'
import setTop from '@/pages/setTop'
import resumeDetail from '@/pages/resumeDetail'
import enterpriseList from '@/pages/memberCenter/enterpriseList';
import enterpriseResume from '@/pages/memberCenter/enterpriseResume'
import resumeN from '@/pages/memberCenter/resumeAll/resume'
import baseResume from '@/pages/memberCenter/resumeAll/baseResume'
import descResume from '@/pages/memberCenter/resumeAll/descResume'
import eduResume from '@/pages/memberCenter/resumeAll/eduResume'
import expResume from '@/pages/memberCenter/resumeAll/expResume'
import labelResume from '@/pages/memberCenter/resumeAll/labelResume'
import wantResume from '@/pages/memberCenter/resumeAll/wantResume'
import searchResume from '@/pages/searchResume'
import releaseJob from '@/pages/releaseJob'
import myRelease from '@/pages/myRelease'
import location from '@/pages/location'
// import searchResume from '@/pages/searchResume'
Vue.use(Router)
let r=''
export default r=new Router({
  routes: [
    {
      path: '/forgetLogin',
      name: 'forgetLogin',
      component:forgetLogin
    },
    {
      path: '/',
      name: 'home',
      alias:'/home',
      component: home
    },
    {
      path: '/work',
      name: 'work',
      component: work
    },
    {
      path: '/search',
      name: 'search',
      component: search
    },
    {
      path: '/investment',
      name: 'investment',
      component: investment
    },
    {
      path: '/nearby',
      name: 'nearby',
      component: nearby
    },
    {
      path: '/people',
      name: 'people',
      component: people
    },
    {
      path: '/me',
      name: 'me',
      component: me
    },
    {
      path: '/me/resume',
      name: 'resume',
      component: resume
    },
    {
      path: '/me/resumeList',
      name: 'resumeList',
      component: resumeList
    },
    {
      path: '/me/release',
      name: 'release',
      component: release
    },
    {
      path: '/me/releaseList',
      name: 'releaseList',
      component: releaseList
    },
    {
      path: '/me/authentication',
      name: 'authentication',
      component: authentication
    },
    {
      path: '/me/authentication/personal',
      name: 'personal',
      component: personal
    },
    {
      path: '/me/authentication/enterprise',
      name: 'enterprise',
      component: enterprise
    },
    {
      path: '/me/authentication/imageUpload',
      name: 'imageUpload',
      component: imageUpload
    },
    {
      path: '/me/security',
      name: 'security',
      component: security
    },
    {
      path: '/me/security/rebuild/:key',
      name: 'rebuild',
      component: rebuild
    },
    {
      path: '/me/security/verification/:phone',
      name: 'verification',
      component: verification
    },
    {
      path: '/me/help',
      name: 'help',
      component: help
    },
    {
      path: '/me/aboutMe',
      name: 'aboutMe',
      component: aboutMe
    },
    {
      path: '/people/details',
      name: 'details',
      component: details
    },
    {
      path: '/me/enterpriseList',
      name: 'enterpriseList',
      component: enterpriseList
    },
    {
      path: '/workDetail/:id',
      name: 'workDetail',
      component: workDetail
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/register',
      name: 'register',
      component: register
    },
    {
      path:'/enterpriseInformation/:id',
      name:'enterpriseInformation',
      component:enterpriseInformation
    },
    {
      path:'/search/searchList',
      name:'searchList',
      component:serarchiList
    },
    {
      path:'/me/checkResume',
      name:'checkResume',
      component:checkResume
    },
    {
      path:'/announcementList',
      name:'announcementList',
      component:announcementList
    },
    {
      path:'/entertainment',
      name:'entertainment',
      component:entertainment
    },{
          path:'/payment/:id',
          name:'payment',
          component:payment
      },
    {
      path:'/setTop/:id',
      name:'setTop',
      component:setTop
    },
    {
      path:'/me/authentication/enterpriseResume/:type',
      name:'enterpriseResume',
      component:enterpriseResume
    },
    {
      path:'/me/memberCenter/resumeAll/resume',
      name:'resumeN',
      component:resumeN
    },
    {
      path:'/me/memberCenter/resumeAll/baseResume',
      name:'baseResume',
      component:baseResume
    },
    {
      path:'/me/memberCenter/resumeAll/descResume',
      name:'descResume',
      component:descResume
    },
    {
      path:'/me/memberCenter/resumeAll/eduResume',
      name:'eduResume',
      component:eduResume
    },
    {
      path:'/me/memberCenter/resumeAll/expResume',
      name:'expResume',
      component:expResume
    },
    {
      path:'/me/memberCenter/resumeAll/labelResume',
      name:'labelResume',
      component:labelResume
    },
    {
      path:'/me/memberCenter/resumeAll/wantResume',
      name:'wantResume',
      component:wantResume
    },
    {
      path:'/searchResume',
      name:'searchResume',
      component:searchResume
    },
    {
      path:'/resumeDetail',
      name:'resumeDetail',
      component:resumeDetail
    },
    {
      path: '/releaseJob',
      name: 'releaseJob',
      component: releaseJob
    },
    {
      path:'/myRelease',
      name:'myRelease',
      component:myRelease
    },
    {
      path:'/location',
      name:'location',
      component:location
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    if(to.name=='workDetail'){
      return {x:0,y:0}
    }
    if (savedPosition) {
      // console.log(savedPosition)
      return savedPosition
    } else {
      return { x: 0, y: 0 }
    }
  }
})


